
JavaArt Chapter 1. On-the-fly Dynamic Compilation and Execution

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains five Java 6 Compiler API examples:

1.  JCompiler0
    (consists of JCompiler0.java)

2.  JCompiler
    (consists of JCompiler.java

3.  StringJCompiler
    (consists of StringJCompiler.java, StringJFO.java)

4.  StringJViewer
     - in its own subdirectory because of its use of BCEL

5.  StringJExecutor
    (consists of StringJExecutor.java, StringJFO.java, 
     ByteJavaFileManager.java, ByteArrayJFO.java,
     ByteClassLoader.java)


There are two Java programs included here, which can be used to
test these examples:
   Comparison.java, Painter.java
    (Note: Painter deliberately uses a deprecated method.)


There is a batch files to simplify execution of the examples:
   runTools.bat
     - it assumes that tools.jar is in c:\Program Files\Java\jdk1.6.0_01\lib\

----------------------------
Compilation:
  > javac *.java

Note: you must have Java 6 installed.
Note: Painter deliberately uses a deprecated method.

----------------------------
Execution of the 5 examples: 

1.  JCompiler0
  >  runTools JCompiler0 <java-file>
e.g.
  > runTools JCompiler0 Painter.java
  > java Painter


2.  JCompiler
  >  runTools JCompiler <java-file>
e.g.
  > runTools JCompiler Comparison.java
  > java Comparison


3.  StringJCompiler
  >  runTools StringJCompiler <name for new class>
e.g.
  > runTools StringJCompiler Foo
  > java Foo andrew


4.  StringJViewer
      - see the readme.txt in StringJViewer/ 

5.  StringJExecutor
  >  runTools StringJExecutor  <input argument for string class>
e.g.
  > runTools StringJExecutor andrew


---------
Last updated: 14th August 2007

